package com.example.demo.client.vm.sysbasequery;

import com.example.demo.format.TreeFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Description:
 *
 * @Author zmf
 * @Date 2018/9/6  10:49
 */
@ApiModel("用户组树")
public class UserGroupTreeVm implements TreeFormat<UserGroupTreeVm, Long>, Serializable {
    private static final long serialVersionUID = 577110693046546979L;
    @ApiModelProperty("用户组ID")
    private Long id;
    @ApiModelProperty("用户组名")
    private String groupName;
    @ApiModelProperty("用户组类别")
    private Integer groupType;
    @ApiModelProperty("父级ID")
    private Long parentId;
    @ApiModelProperty("区域ID")
    private Long regionId;
    @ApiModelProperty("用户组全称")
    private String groupFullName;
    @ApiModelProperty("用户组全称")
    private String fullGroupId;
    @ApiModelProperty("创建人ID")
    private Long createUserId;
    @ApiModelProperty("创建人名称")
    private String createUserName;
    @ApiModelProperty("用户组自己创建")
    private Boolean createYourself = false;
    @ApiModelProperty("子元素")
    private List<UserGroupTreeVm> children;
    @ApiModelProperty("用户组全称为空时取用户组名称")
    private String  displayName;
    @Override
    public Long getId() {
        return id;
    }
    @Override
    public Long getParentId() {
        return parentId;
    }

    @Override
    public void addChildren(UserGroupTreeVm child) {
        if (this.children == null) {
            this.children = new ArrayList<>();
        }
        this.children.add(child);
    }

    public String getCreateUserName() {
        return createUserName;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }

    public String getDisplayName() {
        return displayName;
    }

    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public Integer getGroupType() {
        return groupType;
    }

    public void setGroupType(Integer groupType) {
        this.groupType = groupType;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Long getRegionId() {
        return regionId;
    }

    public void setRegionId(Long regionId) {
        this.regionId = regionId;
    }

    public String getGroupFullName() {
        return groupFullName;
    }

    public void setGroupFullName(String groupFullName) {
        this.groupFullName = groupFullName;
    }

    public String getFullGroupId() {
        return fullGroupId;
    }

    public void setFullGroupId(String fullGroupId) {
        this.fullGroupId = fullGroupId;
    }

    public Long getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }

    public Boolean getCreateYourself() {
        return createYourself;
    }

    public void setCreateYourself(Boolean createYourself) {
        this.createYourself = createYourself;
    }

    public List<UserGroupTreeVm> getChildren() {
        return children;
    }

    public void setChildren(List<UserGroupTreeVm> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return "UserGroupTreeVm{" +
            "id=" + id +
            ", groupName='" + groupName + '\'' +
            ", groupType=" + groupType +
            ", parentId=" + parentId +
            ", regionId=" + regionId +
            ", groupFullName='" + groupFullName + '\'' +
            ", fullGroupId='" + fullGroupId + '\'' +
            ", createUserId=" + createUserId +
            ", createYourself=" + createYourself +
            ", children=" + children +
            '}';
    }
}
